﻿import 'package:star_author/generated/json/base/json_convert_content.dart';
import 'package:star_author/model/shop_title_entity.dart';

ShopTitleEntity $ShopTitleEntityFromJson(Map<String, dynamic> json) {
	final ShopTitleEntity shopTitleEntity = ShopTitleEntity();
	final List<ShopTitleData>? data = jsonConvert.convertListNotNull<ShopTitleData>(json['data']);
	if (data != null) {
		shopTitleEntity.data = data;
	}
	return shopTitleEntity;
}

Map<String, dynamic> $ShopTitleEntityToJson(ShopTitleEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['data'] =  entity.data?.map((v) => v.toJson()).toList();
	return data;
}

ShopTitleData $ShopTitleDataFromJson(Map<String, dynamic> json) {
	final ShopTitleData shopTitleData = ShopTitleData();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopTitleData.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopTitleData.name = name;
	}
	final int? position = jsonConvert.convert<int>(json['position']);
	if (position != null) {
		shopTitleData.position = position;
	}
	final String? backflowTips = jsonConvert.convert<String>(json['backflow_tips']);
	if (backflowTips != null) {
		shopTitleData.backflowTips = backflowTips;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		shopTitleData.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		shopTitleData.updatedAt = updatedAt;
	}
	final String? image = jsonConvert.convert<String>(json['image']);
	if (image != null) {
		shopTitleData.image = image;
	}
	final String? realImage = jsonConvert.convert<String>(json['real_image']);
	if (realImage != null) {
		shopTitleData.realImage = realImage;
	}
	final String? prefix = jsonConvert.convert<String>(json['prefix']);
	if (prefix != null) {
		shopTitleData.prefix = prefix;
	}
	final List<ShopTitleChildrenEntity>? children = jsonConvert.convertListNotNull<ShopTitleChildrenEntity>(json['children']);
	if (children != null) {
		shopTitleData.children = children;
	}
	return shopTitleData;
}

Map<String, dynamic> $ShopTitleDataToJson(ShopTitleData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['position'] = entity.position;
	data['backflow_tips'] = entity.backflowTips;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['image'] = entity.image;
	data['real_image'] = entity.realImage;
	data['prefix'] = entity.prefix;
	data['children'] =  entity.children?.map((v) => v.toJson()).toList();
	return data;
}

ShopChlildrenEntity $ShopChlildrenEntityFromJson(Map<String, dynamic> json) {
	final ShopChlildrenEntity shopChlildrenEntity = ShopChlildrenEntity();
	final List<ShopTitleChildrenEntity>? data = jsonConvert.convertListNotNull<ShopTitleChildrenEntity>(json['data']);
	if (data != null) {
		shopChlildrenEntity.data = data;
	}
	return shopChlildrenEntity;
}

Map<String, dynamic> $ShopChlildrenEntityToJson(ShopChlildrenEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['data'] =  entity.data?.map((v) => v.toJson()).toList();
	return data;
}

ShopTitleChildrenEntity $ShopTitleChildrenEntityFromJson(Map<String, dynamic> json) {
	final ShopTitleChildrenEntity shopTitleChildrenEntity = ShopTitleChildrenEntity();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		shopTitleChildrenEntity.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		shopTitleChildrenEntity.name = name;
	}
	final bool? isSelect = jsonConvert.convert<bool>(json['isSelect']);
	if (isSelect != null) {
		shopTitleChildrenEntity.isSelect = isSelect;
	}
	final List<dynamic>? priceRange = jsonConvert.convertListNotNull<dynamic>(json['priceRange']);
	if (priceRange != null) {
		shopTitleChildrenEntity.priceRange = priceRange;
	}
	return shopTitleChildrenEntity;
}

Map<String, dynamic> $ShopTitleChildrenEntityToJson(ShopTitleChildrenEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['isSelect'] = entity.isSelect;
	data['priceRange'] =  entity.priceRange;
	return data;
}